# @Time : 2021/6/16 10:33
# @Author : Li Kunlun
# @Description :
import numpy as np
import random

# [[3 2]
#  [4 1]
#  [2 3]
#  [1 4]]

rFits = [[3, 2], [4, 1], [2, 3], [1, 4]]
rFits2 = np.argsort(rFits, axis=0)
# [[3 1]
#  [2 0]
#  [0 2]
#  [1 3]]
print(rFits2)
# rSortFits = np.sort(rFits, axis=0)
print(rFits)

rSortFits = np.sort(rFits, axis=0)
print("-----------------")
print(rFits)
print(np.max(rFits, axis=1))

print("-----------------")
list = [1, 2, 3]
print(random.sample(list, 2))
print(type(random.sample(list, 2)))

print("-----------------")
pos1, pos2 = (np.random.randint(0, 4, 2))
print(pos1, pos2)

print("-----------------")
chr1 = np.array([0.1, 1, -1])
lb = 0
chr1[chr1 < lb] = lb
# [0.1 1.  0. ]
print(chr1)

print("-----------------")
# print("【进度】【{0:20s}】【正在进行{1}代...】【共{2}代】".format('▋' * int(iter / 50 * 20), 10, 50), end='\r')
print("【{0:20s}】【正在进行{1}代...】【共{2}代】".format(0, 10, 50), end='\r')
